package com.lpit.mapper;

import com.lpit.dto.UserAndTableTheBehaviorDto;
import com.lpit.pojo.BrowsingHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author Administrator
 * @description 针对表【browsing_history(文章跟用户中间表)】的数据库操作Mapper
 * @createDate 2023-06-27 14:43:33
 * @Entity com.lpit.entity.BrowsingHistory
 */
@Mapper
public interface BrowsingHistoryMapper extends BaseMapper<BrowsingHistory> {
    /**
     * 根据用户id获取自己的文章有多少点赞
     *
     * @param id
     * @return Integer
     */
    public Integer countUpvote(Integer id);

    /**
     * 添加用户与文章的点赞的行为
     *
     * @param userAndTableTheBehaviorDto
     * @return int
     */
    public Integer addGiveAlike(UserAndTableTheBehaviorDto userAndTableTheBehaviorDto);

    /**
     * 添加用户与文章收藏的行为
     *
     * @param userAndTableTheBehaviorDto
     * @return Integer
     */
    public Integer addCollect(UserAndTableTheBehaviorDto userAndTableTheBehaviorDto);

    /**
     * 添加用户与文章标记不喜欢的行为
     *
     * @param userAndTableTheBehaviorDto
     * @return Integer
     */
    public Integer addDislike(UserAndTableTheBehaviorDto userAndTableTheBehaviorDto);

    /**
     * 添加用户与文章转发的行为
     *
     * @param userAndTableTheBehaviorDto
     * @return Integer
     */
    public Integer addTranspond(UserAndTableTheBehaviorDto userAndTableTheBehaviorDto);

}




